package dubboRpc.customer;

import dubboRpc.netty.NettyClient;
import dubboRpc.publicInterface.HelloService;

public class ClientBootstrap {

    //这里定义协议头
    public static final String provideName="Hello#";
    public static void main(String[] args) {
        //创建一个消费者
        NettyClient customer=new NettyClient();
        //创建一个代理对象
        try {
            HelloService service = (HelloService) customer.getBean(HelloService.class, provideName);
            //通过代理对象调用服务提供者的方法（服务）
//            while (true){
            String res = service.hello("你好 dubbo~");
            System.out.println("调用的结果res = " + res);
//            }
        }catch (Exception e){
            System.out.println(e);
        }
        }
}
